package com.ruoyi.wgjlcData.controller;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.wgjlcData.domain.plat.DataWgjlcZdjzdl;
import com.ruoyi.wgjlcData.service.IDataWgjlcZdjzdlService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * 无轨胶轮车最大静制动力Controller
 * 
 * @author ruoyi
 * @date 2024-02-27
 */
@RestController
@RequestMapping("/wgjlc/zdjzdl")
public class DataWgjlcZdjzdlController extends BaseController
{
    @Autowired
    private IDataWgjlcZdjzdlService dataWgjlcZdjzdlService;

    /**
     * 查询无轨胶轮车最大静制动力列表
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zdjzdl:list')")
    @GetMapping("/list")
    public TableDataInfo list(DataWgjlcZdjzdl dataWgjlcZdjzdl)
    {
        startPage();
        List<DataWgjlcZdjzdl> list = dataWgjlcZdjzdlService.selectDataWgjlcZdjzdlList(dataWgjlcZdjzdl);
        return getDataTable(list);
    }

    /**
     * 导出无轨胶轮车最大静制动力列表
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zdjzdl:export')")
    @Log(title = "无轨胶轮车最大静制动力", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, DataWgjlcZdjzdl dataWgjlcZdjzdl)
    {
        List<DataWgjlcZdjzdl> list = dataWgjlcZdjzdlService.selectDataWgjlcZdjzdlList(dataWgjlcZdjzdl);
        ExcelUtil<DataWgjlcZdjzdl> util = new ExcelUtil<DataWgjlcZdjzdl>(DataWgjlcZdjzdl.class);
        util.exportExcel(response, list, "无轨胶轮车最大静制动力数据");
    }

    /**
     * 获取无轨胶轮车最大静制动力详细信息
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zdjzdl:query')")
    @GetMapping(value = "/{zdjzdlId}")
    public AjaxResult getInfo(@PathVariable("zdjzdlId") Long zdjzdlId)
    {
        return success(dataWgjlcZdjzdlService.selectDataWgjlcZdjzdlByZdjzdlId(zdjzdlId));
    }

    /**
     * 新增无轨胶轮车最大静制动力
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zdjzdl:add')")
    @Log(title = "无轨胶轮车最大静制动力", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody DataWgjlcZdjzdl dataWgjlcZdjzdl)
    {
        return toAjax(dataWgjlcZdjzdlService.insertDataWgjlcZdjzdl(dataWgjlcZdjzdl));
    }

    /**
     * 修改无轨胶轮车最大静制动力
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zdjzdl:edit')")
    @Log(title = "无轨胶轮车最大静制动力", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody DataWgjlcZdjzdl dataWgjlcZdjzdl)
    {
        return toAjax(dataWgjlcZdjzdlService.updateDataWgjlcZdjzdl(dataWgjlcZdjzdl));
    }

    /**
     * 删除无轨胶轮车最大静制动力
     */
    @PreAuthorize("@ss.hasPermi('wgjlc:zdjzdl:remove')")
    @Log(title = "无轨胶轮车最大静制动力", businessType = BusinessType.DELETE)
	@DeleteMapping("/{zdjzdlIds}")
    public AjaxResult remove(@PathVariable Long[] zdjzdlIds)
    {
        return toAjax(dataWgjlcZdjzdlService.deleteDataWgjlcZdjzdlByZdjzdlIds(zdjzdlIds));
    }
}
